/**
 * This is an abstract Package class that has two children and implements Comparable.
 * It has an explicit and default value constructors that are called by its children.
 * It has a compareTo method that compares first by the name of the package and and then by the weight.
 * It also has a toString method, getWeight, and an abstract getPackageType methods that are all needed to run the 
 * program. 
 * <p><b>
 * Extra Credit:
 * </b><pre>
 * No extra credit was offered on this assignment
 * </pre><b>
 *
 * History:
 * </b><pre>
 * 5/04/2007 started writing the program
 * 5/08/2007 continued working on it
 * 5/09/2007 finished writing the program
 * </pre>
 *
 * @author  Veniamin Kozubenko
 * @see     "No Borrowed Code" 
 *     	
 */
public abstract class Package implements Comparable <Package>
{
	private int _weight;
	private int _trackingNumber;
	
	public Package()
	{ } // End default value constructor
	
	public Package(int trackingNumber, int weight)
	{
		_trackingNumber = trackingNumber;
		_weight = weight;
	} // End default value constructor
	
	public abstract String getPackageType();
	
	public int getWeight()
	{ return _weight; } // End getWeight() method
	
	public String toString()
	{
		String temp;
		temp  = "Tracking Number: " + _trackingNumber;
		return temp;
	} // End toString method
	

	public int compareTo(Package rhs)
	{
		if(getPackageType().compareTo(rhs.getPackageType()) != 0)
			return getPackageType().compareTo(rhs.getPackageType());
		
		else if(_weight != rhs._weight)
			return _weight - rhs._weight;
		
		else return 0;
	
	} // end compareTo method
	




} // End class Truck